import react from '@vitejs/plugin-react'
import path from 'path'
import { defineConfig } from 'vite'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    react(),
  ],
  resolve: {
    alias: {
      // 设置路径
      // eslint-disable-next-line no-undef
      '~': path.resolve(__dirname, '/'),
      // 设置别名
      // eslint-disable-next-line no-undef
      '@': path.resolve(__dirname, 'src'),
    },
  },
  css: {
    preprocessorOptions: {
      less: {
        modifyVars: {
          // 全局样式这里改
        },
        javascriptEnabled: true,
      },
    },
  },
  server: {
    proxy: {
      '/v3': {
        target: 'https://emcweb.test700.xyz/v3',
        changeOrigin: true,
        rewrite: path => path.replace(/^\/v3/, '')
      }
    }
  }
})
